#include "MyPool.h"

typedef struct { 
    void                *data;
    char				*buf;
    char                *name;
    int					num;
} nlu_connection_t;

int main()
{
	CMyPool my;
	nlu_connection_t *c;
	size_t size = 80;//(80b)
	nlu_pool_t *pool;
	
	pool = my.createPool(size);		
	
	c = (nlu_connection_t *)my.nluPcalloc(pool, sizeof(nlu_connection_t));
	
	std::cout<<"\n";
	
	c->num = 8;
	c->buf = (char*)my.nluPcalloc(pool, 100);
	strncpy(c->buf, "hi! everyone is OK? ", 100);
	
	c->name = (char*)my.nluPcalloc(pool, 33);
	strncpy(c->buf, "my name is luyujun! ", 33);
	
	llog("num:%d", c->num);
	llog("size:%d", size);
	llog("buf:%s", c->buf);
	
	my.destoryPool(pool);
	return 0;
}
